#define _CRT_SECURE_NO_WARNINGS 1

#include"BinaryTree.h"


BTNode* BuyTreeNode(BTDataType x)
{
	BTNode* node = (BTNode*)malloc(sizeof(BTNode));
	if (node == NULL)
	{
		perror("malloc fail");
		return NULL;
	}
	node->val = x;
	node->left = NULL;
	node->right = NULL;
}

int main()
{
	BTNode* n1 = BuyTreeNode(1);
	BTNode* n2 = BuyTreeNode(2);
	BTNode* n3 = BuyTreeNode(3);
	BTNode* n4 = BuyTreeNode(4);
	BTNode* n5 = BuyTreeNode(5);
	BTNode* n6 = BuyTreeNode(6);
	BTNode* n7 = BuyTreeNode(7);

	n1->left = n2;
	n1->right = n4;
	n2->left = n3;
	n4->left = n5;
	n4->right = n6;
	n2->right = n7;

	/*_BinaryTreeLevelOrder(n1);
	printf("%d\n", BinaryTreeSize(n1));
	printf("%d\n", BinaryTreeLeafSize(n1));*/
	printf("%d\n", BinaryTreeComplete(n1));

	/*BTNode* tmp = BinaryTreeFind(n1, 6);
	tmp->val = 60;
	BinaryTreePrevOrder(n1);*/

	return 0;
}
